package zhtt.httpsession.config;
//
//import org.testcontainers.containers.GenericContainer;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;

@Configuration
@Profile("embedded-redis")
public class EmbeddedRedisConfig {

	private static final String DOCKER_IMAGE = "redis:5.0.4";

//	@Bean
//	public GenericContainer redisContainer() {
//		GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE)
//				.withExposedPorts(6379);
//		redisContainer.start();
//		return redisContainer;
//	}
//
//	@Bean
//	@Primary
//	public LettuceConnectionFactory redisConnectionFactory() {
//		return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
//				redisContainer().getFirstMappedPort());
//	}

}
